package com.xxx.bz;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/20 11:05
 * @Copyright 博为峰
 */
public class Demo01 {
    public static void main(String[] args) {
        /*
           byte     Byte
           short    Short
           int      Integer
           long     Long
           float    Float
           double   Double
           char     Character (没有parseXxx)
           boolean  Boolean

           xxx parseXxx("xxx类型的数据")
         */

//        m1();
        //jdk5
        Integer i = 6;//自动装箱  Integer i = new Integer(6);
        i = i + 1;//自动拆箱 new Integer(i.intValue() + 1)

        Integer integer1 = new Integer(100);
        Integer integer2 = new Integer(100);
        System.out.println(integer1 == integer2);//false
        System.out.println(integer1.equals(integer2));//true

        Integer i3 = 128;//自动装箱，如果装箱的是一个字节，那么数据会被共享不会重写创建对象
        Integer i4 = 128;
        System.out.println(i3 == i4);//true
        System.out.println(i3.equals(i4));//true

    }

    public static void m1() {
        System.out.println(Integer.MAX_VALUE);

        Integer integer = new Integer(6);

//        int i = Integer.parseInt("5");

        System.out.println(Integer.toBinaryString(6));
        System.out.println(Integer.toHexString(6));
        System.out.println(Integer.toOctalString(6));
    }
}
